package com.csw.clazzMe.service;

import com.csw.clazzMe.dao.CityDao;
import com.csw.clazzMe.entity.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by Administrator on 2019/10/28.
 */
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class CityServiceImpl implements CityService {
	@Autowired
	private CityDao cityDao;

	@Transactional(rollbackFor = Exception.class)
	@Override
	public List<City> queryAll() {
		return cityDao.queryAll();
	}

	@Override
	public void add(City city) {
		cityDao.add(city);
	}
}
